<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * Ftpquotatallies filter form base class.
 *
 * @package    filters
 * @subpackage Ftpquotatallies *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseFtpquotatalliesFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'name'            => new sfWidgetFormFilterInput(),
      'quota_type'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'bytes_in_used'   => new sfWidgetFormFilterInput(),
      'bytes_out_used'  => new sfWidgetFormFilterInput(),
      'bytes_xfer_used' => new sfWidgetFormFilterInput(),
      'files_in_used'   => new sfWidgetFormFilterInput(),
      'files_out_used'  => new sfWidgetFormFilterInput(),
      'files_xfer_used' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'name'            => new sfValidatorPass(array('required' => false)),
      'quota_type'      => new sfValidatorChoice(array('required' => false, 'choices' => array('user' => 'user', 'group' => 'group', 'class' => 'class', 'all' => 'all'))),
      'bytes_in_used'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bytes_out_used'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bytes_xfer_used' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'files_in_used'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'files_out_used'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'files_xfer_used' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('ftpquotatallies_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ftpquotatallies';
  }

  public function getFields()
  {
    return array(
      'id'              => 'Number',
      'name'            => 'Text',
      'quota_type'      => 'Enum',
      'bytes_in_used'   => 'Number',
      'bytes_out_used'  => 'Number',
      'bytes_xfer_used' => 'Number',
      'files_in_used'   => 'Number',
      'files_out_used'  => 'Number',
      'files_xfer_used' => 'Number',
    );
  }
}